<?php
include dirname(dirname(__FILE__)).'/include/user-verify.php';
?>

<!DOCTYPE html>
<html>
<head>
	<?php include dirname(dirname(__FILE__)).'/include/common-header.php'; ?>
	<link rel="stylesheet" type="text/css" href="css/style.css">
	<script type="text/javascript">
		var tm = 0;
		function getRunTime() {
			var ret = 0;
			$.ajax({
				dataType:"text",
				url:'ajax/get-run-time.php',
				data:{},
				success:function(data) {
					var mydate = new Date();
					tm = mydate.getTime()/1000-data;
					printTime();
					setInterval(printTime,1000);
				},
			});
		}
		function printTime() {
			//console.log(tm);
			var _year = Math.floor(tm/(3600*24*365));
			var _mon = Math.floor((tm%(3600*24*365))/(3600*24*30));
			var _day = Math.floor((tm%(3600*24*30))/(3600*24));
			var _hour = Math.floor((tm%(3600*24))/(3600));
			var _min = Math.floor((tm%3600)/60);
			var _sec = Math.floor(tm%60);
			var _pri = "";
			if(_year>0)_pri=_pri+_year+'年';
			if(_mon>0)_pri=_pri+_mon+'月'+'<br>';
			if(_day>0)_pri=_pri+_day+'天';
			var _pri=_pri+_hour+'小时'+'<br>'+_min+'分钟'+_sec+'秒';
			$("#time").html(_pri); 
			tm++;
		}
		$(document).ready(function() {
			getRunTime();
		});
	</script>
</head>
<body>
	<div class="col-md-12">
		<h3 style="text-align:center">服务器运行信息</h3>
	</div>
	<div class="col-md-12">
		<table class="table table-striped table-bordered table-hover table-condensed" id="default-table">
			<tr>
				<th>服务器运行系统</th>
				<th>服务器解释引擎</th>
				<th>服务器IP</th>
				<th>PHP版本</th>
				<th>服务器协议版本</th>
				<th>服务器已运行时间</th>
			</tr>
			<tr>
				<td><?php echo php_uname(); ?></td>
				<td><?php echo $_SERVER['SERVER_SOFTWARE']; ?></td>
				<td><?php echo GetHostByName($_SERVER['SERVER_NAME']); ?></td>
				<td><?php echo PHP_VERSION; ?></td>
				<td><?php echo $_SERVER['SERVER_PROTOCOL']; ?></td>
				<td id="time"></td>
			</tr>
		</table>
	</div>
</body>
</html>
